From 3ce79da0b12cf23f0976feb4ffa9c1d49a717e92 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 23 Mar 2015 16:22:04 -0700 Subject: [PATCH] len() == 0 => is_empty() --- src/bin/bench.rs | 2 +- src/bin/cargo.rs | 2 +- src/bin/run.rs | 2 +- src/bin/test.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/bench.rs b/src/bin/bench.rs index bdbcc96a8..735b2e0d4 100644 --- a/src/bin/bench.rs +++ b/src/bin/bench.rs @@ -67,7 +67,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { exec_engine: None, release: true, mode: ops::CompileMode::Bench, - filter: if benches.len() == 0 { + filter: if benches.is_empty() { ops::CompileFilter::Everything } else { ops::CompileFilter::Only { diff --git a/src/bin/cargo.rs b/src/bin/cargo.rs index 0ad3a53c2..7c04323cd 100644 --- a/src/bin/cargo.rs +++ b/src/bin/cargo.rs @@ -105,7 +105,7 @@ fn execute(flags: Flags, config: &Config) -> CliResult> { // For the commands `cargo` and `cargo help`, re-execute ourselves as // `cargo -h` so we can go through the normal process of printing the // help message. - "" | "help" if flags.arg_args.len() == 0 => { + "" | "help" if flags.arg_args.is_empty() => { config.shell().set_verbose(true); let args = &["cargo".to_string(), "-h".to_string()]; let r = cargo::call_main_without_stdin(execute, config, USAGE, args, diff --git a/src/bin/run.rs b/src/bin/run.rs index 8093d5b65..9ff8728fa 100644 --- a/src/bin/run.rs +++ b/src/bin/run.rs @@ -64,7 +64,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { exec_engine: None, release: options.flag_release, mode: ops::CompileMode::Build, - filter: if examples.len() == 0 && bins.len() == 0 { + filter: if examples.is_empty() && bins.is_empty() { ops::CompileFilter::Everything } else { ops::CompileFilter::Only { diff --git a/src/bin/test.rs b/src/bin/test.rs index b6f9a12e9..1b09e6d2c 100644 --- a/src/bin/test.rs +++ b/src/bin/test.rs @@ -74,7 +74,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { exec_engine: None, release: false, mode: ops::CompileMode::Test, - filter: if tests.len() == 0 && bins.len() == 0 { + filter: if tests.is_empty() && bins.is_empty() { ops::CompileFilter::Everything } else { ops::CompileFilter::Only { -- 2.30.2